import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
   //引入vue里面的文件
   {
    path:"/",
    name:"Main",
    component:() => import("../views/Main.vue"),
     children:[
       {
        path:"find",
        alias:"",
        name:"Find",
        component:() => import("../views/Find.vue")
       },
       {
        path:"boke",
        name:"Boke",
        component:() => import("../views/Boke.vue")
       },
       {
        path:"my",
        name:"My",
        component:() => import("../views/My.vue"),
        

       },
       {
        path:"guanzhu",
        name:"Guanzhu",
        component:() => import("../views/Guanzhu.vue")
       },
       {
        path:"yuncun",
        name:"Yuncun",
        component:() => import("../views/Yuncun.vue"),
        meta:{
          needLogin:true
        } 
      }
     ]
   },

   {
    path:"/itemMusic/:id",
    name:"ItemMusic",
    component:() => import("../views/ItemMusic.vue")
   },
   {
    path:"gesoulieb",
    name:"Gesoulieb",
    component:() => import("../views/Gesoulieb.vue")
   },
    //一级要加斜杠
   {
    path: '/singsong/:id',
    name: 'Singsong',
    component: () => import('../views/Singsong.vue')
  },
  {
    path: '/danqu/:id',
    name: 'Danqu',
    component: () => import('../views/Danqu.vue')
  },
  {
    path: '/search',
    name: 'Search',
    component: () => import('../views/Search.vue')
  }

]



const router = new VueRouter({
  routes
})

export default router
